chrome.runtime.onMessage.addListener(
  function(request, sender, sendResponse) {
    if (request.action == "getTabs")
      chrome.tabs.query({}, function(tabs) {
        var tabInfo = tabs.map(function(tab) {
          return {
            title: tab.title,
            url: tab.url
        };
      });
      // sendResponse({farewell: tabInfo});
      sendResponse({tabInfo: tabInfo});
    });
  return true; // will response asynchronously 
});